/*******************************************************************************
  * @file    main.c
  * @author  Friday
  * @version V1.0.0
  * @date    2021-08-12
  * @brief   Mass Storage demo main file
	* @board   miniSystemBoard
*******************************************************************************/


#include "hw_config.h" 
#include "usb_lib.h"
#include "usb_pwr.h"

extern uint16_t MAL_Init (uint8_t lun);

extern uint32_t Mass_Memory_Size[2];
extern uint32_t Mass_Block_Size[2];
extern uint32_t Mass_Block_Count[2];

//=============================================================================
//=============================================================================
int main(void)
{
	SD_Initialize();
	Mass_Block_Count[0] = SD_GetSectorCount();
	Mass_Block_Size[0] =512;
	Mass_Memory_Size[0] = Mass_Block_Count[0] * Mass_Block_Size[0];
	
  Set_System();
  Set_USBClock();
  USB_Interrupts_Config();
  USB_Init();
  while (bDeviceState != CONFIGURED);

  while (1)
  {}
}



















#ifdef USE_FULL_ASSERT
/*******************************************************************************
* Function Name  : assert_failed
* Description    : Reports the name of the source file and the source line number
*                  where the assert_param error has occurred.
* Input          : - file: pointer to the source file name
*                  - line: assert_param error line source number
* Output         : None
* Return         : None
*******************************************************************************/
void assert_failed(uint8_t* file, uint32_t line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {}
}
#endif

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
